<template>
  <div>
    <div class="mb">
      <el-button type="default" size="small" @click="">
        <d2-icon name="plus" />
        增行
      </el-button>
      <el-button type="default" size="small" icon="el-icon-delete">
        删行
      </el-button>
    </div>
    <el-table :data="tableData" border>
      <el-table-column prop="name" label="价格项ID" sortable>
        <template slot-scope="scope">
          <el-input
            placeholder="请输入内容"
            v-show="scope.row.show"
            v-model="scope.row.address"
          ></el-input>
          <span v-show="!scope.row.show">{{ scope.row.address }}</span>
        </template>
      </el-table-column>
      <el-table-column prop="name" label="价格项名称" sortable>
        <template slot-scope="scope">
          <el-input
            placeholder="请输入内容"
            v-show="scope.row.show"
            v-model="scope.row.address"
          ></el-input>
          <span v-show="!scope.row.show">{{ scope.row.address }}</span>
        </template></el-table-column
      >
      <el-table-column prop="address" label="日期" sortable>
        <template slot-scope="scope">
          <el-input
            placeholder="请输入内容"
            v-show="scope.row.show"
            v-model="scope.row.address"
          ></el-input>
          <span v-show="!scope.row.show">{{ scope.row.address }}</span>
        </template>
      </el-table-column>
      <el-table-column prop="sign" label="价格" sortable>
        <template slot-scope="scope">
          <el-input
            placeholder="请输入内容"
            v-show="scope.row.show"
            v-model="scope.row.address"
          ></el-input>
          <span v-show="!scope.row.show">{{ scope.row.address }}</span>
        </template>
      </el-table-column>
      <el-table-column prop="amount_2" label="来源" sortable>
        <template slot-scope="scope">
          <el-input
            placeholder="请输入内容"
            v-show="scope.row.show"
            v-model="scope.row.address"
          ></el-input>
          <span v-show="!scope.row.show">{{ scope.row.address }}</span>
        </template>
      </el-table-column>
    </el-table>
  </div>
</template>
<script>
export default {
  //自定义现货行情-新增
  name: "custom_spot_market_M",
  props: ["rowaa"],
  data() {
    return {
      formData: "",
      tableData: [{ name: "11", address: "22", show: true }]
    };
  },
  created() {
    this.getData();
  },
  watch: {
    rowaa: "getData"
  },
  methods: {
    getData() {
      //从后台获取数据逻辑 model.CacheModel.get('api/' + this.rowaa + '.json')
      //通过this.rowaa就可以获取传过来的值
      this.formData = 333;
    }
  }
};
</script>
